<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  <meta name="renderer" content="webkit">

  
  <title>Android 10.0 滑动解锁流程 | 龙之叶的博客</title>

  <link rel="shortcut icon" href="/images/favicon.png">
  <link rel="alternate" href="/atom.xml" title="龙之叶的博客" type="application/atom+xml">
  <meta name="description" content="Android 10.0 滑动解锁流程">
<meta property="og:type" content="article">
<meta property="og:title" content="Android 10.0 滑动解锁流程">
<meta property="og:url" content="http://longzhiye.top/2023/12/30/2023-12-30/index.html">
<meta property="og:site_name" content="龙之叶的博客">
<meta property="og:description" content="Android 10.0 滑动解锁流程">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-12-29T16:00:00.000Z">
<meta property="article:modified_time" content="2024-08-29T02:40:34.917Z">
<meta property="article:author" content="龙之叶">
<meta property="article:tag" content="Android">
<meta property="article:tag" content="SystemUI">
<meta property="article:tag" content="framework">
<meta property="article:tag" content="Launcher">
<meta name="twitter:card" content="summary">

  <meta name="keywords" content=",Android,SystemUI,framework,Launcher">
  <meta name="format-detection" content="telephone=no,email=no">
  <meta name="theme-color" content="#9C27B0">

  <meta name="mobile-web-app-capable" content="yes">
  <meta name="application-name" content="龙之叶的博客">
  <meta name="msapplication-starturl" content="http://longzhiye.top/2023/12/30/2023-12-30/">
  <meta name="msapplication-navbutton-color" content="#9C27B0">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-title" content="龙之叶的博客">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <link rel="apple-touch-icon" href="/images/favicon.png">

  
    <link rel="canonical" href="http://longzhiye.top/2023/12/30/2023-12-30/">
  

  
  

  
  
  

  
<link rel="stylesheet" href="/css/mdui.css">
<link rel="stylesheet" href="/css/style.css">

  
<link rel="stylesheet" href="/custom.css">

<meta name="generator" content="Hexo 5.4.2"></head>

<body class="mdui-appbar-with-toolbar mdui-theme-primary-indigo mdui-theme-accent-pink">
  <script>var a=localStorage.getItem("mdui-theme-layout-dark");if(a){document.getElementsByTagName("body")[0].className+=" mdui-theme-layout-dark"};</script>
  <script>if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches){document.getElementsByTagName("body")[0].className+=" mdui-theme-layout-dark"};</script>
  <script>var a=localStorage.getItem("mdui-drawer-close");if(!a){document.getElementsByTagName("body")[0].className+=" mdui-drawer-body-left"};</script>
  <header id="header" class="mdui-appbar mdui-appbar-fixed mdui-appbar-scroll-hide mdui-appbar-inset">
  <div class="mdui-toolbar mdui-color-theme">
    <a href="javascript:;" class="mdui-btn mdui-btn-icon" mdui-drawer="{target: '#sidebar', swipe: true}"><i class="mdui-icon material-icons">menu</i></a>
    <a href="/" class="mdui-typo-headline">龙之叶的博客</a>
    <div class="mdui-toolbar-spacer"></div>
    <a href="javascript:;" class="mdui-btn mdui-btn-icon" mdui-dialog="{target: '#search'}" mdui-tooltip="{content: '搜索'}"><i class="mdui-icon material-icons">search</i></a>
	<!--
    <a href="/atom.xml" class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: 'RSS'}"><i class="mdui-icon material-icons">rss_feed</i></a>
	-->
  </div>
</header>
<div class="mdui-dialog" id="search">
  
    <div class="search-form">
      <input type="search" class="search-form-input" placeholder="请输入关键字">
    </div>
    <div class="search-result" data-resource="/search.xml"></div>
  
</div>

  <aside id="sidebar" class="mdui-drawer mdui-drawer-full-height">
  <script>var a=localStorage.getItem("mdui-drawer-close");if(a){document.getElementById("sidebar").className+=" mdui-drawer-close"};</script>
  <div class="mdui-grid-tile">
    <img src="/images/banner.png" style="height: 160px;">
    <img src="/images/avatar.png" class="avatar-animation" style="position: absolute; top: 10%; left: 24px; width: 64px; height: 64px; border: 2px solid #fff; border-radius: 50%;background-color:#fff;">
    <div class="mdui-grid-tile-actions">
      <div class="mdui-grid-tile-text">
        <div class="mdui-grid-tile-title">龙之叶</div>
        <div class="mdui-grid-tile-subtitle"><i class="mdui-icon material-icons">art_track</i>生命不息，折腾不止</div>
      </div>
      
        <div class="mdui-grid-tile-buttons">
          <a href="mailto:longzhiye163@163.com" class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: 'longzhiye163@163.com'}"><i class="mdui-icon material-icons">email</i></a>
        </div>
      
    </div>
  </div>

  <div class="mdui-list" mdui-collapse="{accordion: true}">
    <a href="/" class="mdui-list-item mdui-ripple">
      <i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-blue">home</i>
      <div class="mdui-list-item-content">主页</div>
    </a>
    <div class="mdui-collapse-item">
      <script>var a=localStorage.getItem("mdui-collapse-item-0");if(a){document.getElementsByClassName("mdui-collapse-item")[0].className+=" mdui-collapse-item-open"};</script>
      <div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
        <i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-deep-orange">archive</i>
        <div class="mdui-list-item-content">归档</div>
        <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
      </div>
      <div class="mdui-collapse-item-body mdui-list mdui-list-dense">
        
        <a class="mdui-ripple sidebar_archives-link" href="/archives/2025/07/">七月 2025<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2025/06/">六月 2025<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2025/03/">三月 2025<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2025/02/">二月 2025<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2025/01/">一月 2025<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2024/10/">十月 2024<span class="mdui-ripple sidebar_archives-count">7</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2024/09/">九月 2024<span class="mdui-ripple sidebar_archives-count">4</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2024/08/">八月 2024<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2024/03/">三月 2024<span class="mdui-ripple sidebar_archives-count">5</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2024/02/">二月 2024<span class="mdui-ripple sidebar_archives-count">11</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2024/01/">一月 2024<span class="mdui-ripple sidebar_archives-count">9</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/12/">十二月 2023<span class="mdui-ripple sidebar_archives-count">10</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/11/">十一月 2023<span class="mdui-ripple sidebar_archives-count">8</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/10/">十月 2023<span class="mdui-ripple sidebar_archives-count">8</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/09/">九月 2023<span class="mdui-ripple sidebar_archives-count">3</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/08/">八月 2023<span class="mdui-ripple sidebar_archives-count">6</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/06/">六月 2023<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/05/">五月 2023<span class="mdui-ripple sidebar_archives-count">4</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/04/">四月 2023<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/03/">三月 2023<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2023/02/">二月 2023<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2022/09/">九月 2022<span class="mdui-ripple sidebar_archives-count">7</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2022/08/">八月 2022<span class="mdui-ripple sidebar_archives-count">4</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2017/04/">四月 2017<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2017/03/">三月 2017<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2017/02/">二月 2017<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2017/01/">一月 2017<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2016/12/">十二月 2016<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2016/11/">十一月 2016<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2016/10/">十月 2016<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/archives/2016/08/">八月 2016<span class="mdui-ripple sidebar_archives-count">1</span></a>
        
      </div>
    </div>
    <div class="mdui-collapse-item">
      <script>var a=localStorage.getItem("mdui-collapse-item-1");if(a){document.getElementsByClassName("mdui-collapse-item")[1].className+=" mdui-collapse-item-open"};</script>
      <div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
        <i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-green">class</i>
        <div class="mdui-list-item-content">分类</div>
        <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
      </div>
      <div class="mdui-collapse-item-body mdui-list mdui-list-dense">
        
        <a class="mdui-ripple sidebar_archives-link" href="/categories/%E6%8A%80%E6%9C%AF/">技术<span class="mdui-ripple sidebar_archives-count">98</span></a><a class="mdui-ripple sidebar_archives-link" href="/categories/%E7%94%9F%E6%B4%BB/">生活<span class="mdui-ripple sidebar_archives-count">3</span></a><a class="mdui-ripple sidebar_archives-link" href="/categories/%E8%B5%84%E8%AE%AF/">资讯<span class="mdui-ripple sidebar_archives-count">4</span></a><a class="mdui-ripple sidebar_archives-link" href="/categories/%E9%80%9A%E7%9F%A5/">通知<span class="mdui-ripple sidebar_archives-count">4</span></a>
        
      </div>
    </div>
    <div class="mdui-collapse-item">
      <script>var a=localStorage.getItem("mdui-collapse-item-2");if(a){document.getElementsByClassName("mdui-collapse-item")[2].className+=" mdui-collapse-item-open"};</script>
      <div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
        <i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-brown">bookmark</i>
        <div class="mdui-list-item-content">标签</div>
        <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
      </div>
      <div class="mdui-collapse-item-body mdui-list mdui-list-dense">
        
        <a class="mdui-ripple sidebar_archives-link" href="/tags/ANR/" rel="tag">ANR<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/APP/" rel="tag">APP<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Android/" rel="tag">Android<span class="mdui-ripple sidebar_archives-count">89</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Android12/" rel="tag">Android12<span class="mdui-ripple sidebar_archives-count">3</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Android13/" rel="tag">Android13<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Android14/" rel="tag">Android14<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/AndroidStudio/" rel="tag">AndroidStudio<span class="mdui-ripple sidebar_archives-count">3</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/AutoDraw/" rel="tag">AutoDraw<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Crash/" rel="tag">Crash<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Foxmail/" rel="tag">Foxmail<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Framework/" rel="tag">Framework<span class="mdui-ripple sidebar_archives-count">20</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/GPS%E8%BD%A8%E8%BF%B9%E5%9B%BE/" rel="tag">GPS轨迹图<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Git/" rel="tag">Git<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/GitHub/" rel="tag">GitHub<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Google/" rel="tag">Google<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Hexo/" rel="tag">Hexo<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Java/" rel="tag">Java<span class="mdui-ripple sidebar_archives-count">3</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Kernel/" rel="tag">Kernel<span class="mdui-ripple sidebar_archives-count">4</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Launcher/" rel="tag">Launcher<span class="mdui-ripple sidebar_archives-count">17</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Lib/" rel="tag">Lib<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Linux/" rel="tag">Linux<span class="mdui-ripple sidebar_archives-count">18</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Markdown/" rel="tag">Markdown<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Material-Design/" rel="tag">Material Design<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/OS-X/" rel="tag">OS X<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/OTA/" rel="tag">OTA<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/QuickTime/" rel="tag">QuickTime<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/SSH/" rel="tag">SSH<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Settings/" rel="tag">Settings<span class="mdui-ripple sidebar_archives-count">6</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/SystemUI/" rel="tag">SystemUI<span class="mdui-ripple sidebar_archives-count">19</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Ubuntu/" rel="tag">Ubuntu<span class="mdui-ripple sidebar_archives-count">7</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/WPS/" rel="tag">WPS<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Wifi/" rel="tag">Wifi<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/WindTerm/" rel="tag">WindTerm<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/Windows/" rel="tag">Windows<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/androidmk/" rel="tag">androidmk<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/blog/" rel="tag">blog<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/build/" rel="tag">build<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/feel/" rel="tag">feel<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/framework/" rel="tag">framework<span class="mdui-ripple sidebar_archives-count">50</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/git/" rel="tag">git<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/inotify/" rel="tag">inotify<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/life/" rel="tag">life<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/ninja/" rel="tag">ninja<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/rsync/" rel="tag">rsync<span class="mdui-ripple sidebar_archives-count">2</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/standard/" rel="tag">standard<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/test/" rel="tag">test<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1/" rel="tag">企业微信<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" rel="tag">操作系统<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/%E6%B5%8B%E8%AF%95/" rel="tag">测试<span class="mdui-ripple sidebar_archives-count">1</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/%E6%BA%90%E7%A0%81/" rel="tag">源码<span class="mdui-ripple sidebar_archives-count">3</span></a><a class="mdui-ripple sidebar_archives-link" href="/tags/%E7%94%9F%E6%B4%BB%E6%84%9F%E6%82%9F/" rel="tag">生活感悟<span class="mdui-ripple sidebar_archives-count">1</span></a>
        
      </div>
    </div>
    <a href="/about" class="mdui-list-item mdui-ripple">
      <i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-purple">person</i>
      <div class="mdui-list-item-content">关于</div>
    </a>
  </div>

  <div class="mdui-divider"></div>

  <div class="mdui-list" mdui-collapse="{accordion: true}">
    
      <a href="/timeline" class="mdui-list-item mdui-ripple">时间轴</a>
    
    <div class="mdui-collapse-item">
      <script>var a=localStorage.getItem("mdui-collapse-item-3");if(a){document.getElementsByClassName("mdui-collapse-item")[3].className+=" mdui-collapse-item-open"};</script>
      <div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
        <div class="mdui-list-item-content">友情链接</div>
        <i class="mdui-list-item-icon mdui-icon material-icons">link</i>
      </div>
      <div class="mdui-collapse-item-body mdui-list mdui-list-dense">
        
          <a href="http://www.niemingzhao.top" target="_blank" class="mdui-list-item mdui-p-l-2 mdui-text-color-theme-accent mdui-ripple" style="justify-content: center;">聂明照的博客</a>
        
        
      </div>
    </div>
  </div>
</aside>

  <main id="main" class="mdui-m-t-5 fadeIn animated">
  
<link rel="stylesheet" href="//cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css">

  <style>#main article .mdui-card-content .center-block{display:block!important;margin-right:auto!important;margin-left:auto!important}</style>
  <style>#main article .mdui-card-content .text-center{text-align:center!important}</style>
  <article class="mdui-card mdui-m-b-5">
    <header class="mdui-card-media">
      <img src="/images/random/material-12.png" style="max-height: 240px;">
      <div class="mdui-card-media-covered">
        <div class="mdui-card-primary">
          <div class="mdui-card-primary-title">Android 10.0 滑动解锁流程</div>
          <div class="mdui-card-primary-subtitle"><i class="iconfont">&#xe697;</i> 2023-12-30 / <i class="iconfont">&#xe601;</i> 龙之叶 &nbsp;&nbsp; <span id="busuanzi_container_page_pv" style="display: none;"><i class="iconfont">&#xe7fd;</i> <span id="busuanzi_value_page_pv"></span></span></div>
        </div>
      </div>
      <div class="mdui-card-menu">
        
          <button class="mdui-btn mdui-btn-icon mdui-text-color-white" mdui-menu="{target: '#qrcode', align: 'right'}"><i class="mdui-icon material-icons">devices</i></button>
          <ul class="mdui-menu" id="qrcode">
            
              <li class="mdui-menu-item"><a class="mdui-text-center mdui-ripple">发送到手机</a></li>
            
            <li class="mdui-menu-item" disabled>
              
                <img src="//qr.liantu.com/api.php?w=246&m=10&text=http://longzhiye.top/2023/12/30/2023-12-30/">
              
            </li>
          </ul>
        
        
          <button class="mdui-btn mdui-btn-icon mdui-text-color-white" mdui-menu="{target: '#share_menu', align: 'right'}"><i class="mdui-icon material-icons">share</i></button>
          <ul class="mdui-menu" id="share_menu">
            <li class="mdui-menu-item">
              <a href="https://service.weibo.com/share/share.php?appkey=&title=Android 10.0 滑动解锁流程&url=http://longzhiye.top/2023/12/30/2023-12-30/&pic=http://longzhiye.top/images/favicon.png&searchPic=false&style=simple" target="_blank" class="mdui-ripple">分享到 Weibo</a>
            </li>
            <li class="mdui-menu-item">
              <a href="https://twitter.com/intent/tweet?text=Android 10.0 滑动解锁流程&url=http://longzhiye.top/2023/12/30/2023-12-30/&via=龙之叶" target="_blank" class="mdui-ripple">分享到 Twitter</a>
            </li>
            <li class="mdui-menu-item">
              <a href="https://www.facebook.com/sharer/sharer.php?u=http://longzhiye.top/2023/12/30/2023-12-30/" target="_blank" class="mdui-ripple">分享到 Facebook</a>
            </li>
            <li class="mdui-menu-item">
              <a href="https://plus.google.com/share?url=http://longzhiye.top/2023/12/30/2023-12-30/" target="_blank" class="mdui-ripple">分享到 Google+</a>
            </li>
            <li class="mdui-menu-item">
              <a href="https://www.linkedin.com/shareArticle?mini=true&url=http://longzhiye.top/2023/12/30/2023-12-30/&title=Android 10.0 滑动解锁流程" target="_blank" class="mdui-ripple">分享到 LinkedIn</a>
            </li>
            <li class="mdui-menu-item">
              <a href="https://connect.qq.com/widget/shareqq/index.html?site=龙之叶的博客&title=Android 10.0 滑动解锁流程&pics=http://longzhiye.top/images/favicon.png&url=http://longzhiye.top/2023/12/30/2023-12-30/" target="_blank" class="mdui-ripple">分享到 QQ</a>
            </li>
            <li class="mdui-menu-item">
              <a href="https://telegram.me/share/url?url=http://longzhiye.top/2023/12/30/2023-12-30/&text=Android 10.0 滑动解锁流程" target="_blank" class="mdui-ripple">分享到 Telegram</a>
            </li>
          </ul>
        
      </div>
    </header>
    <div class="mdui-card-content mdui-typo">
      <h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>滑动解锁相对于来说逻辑还是简单的，说白了就是对事件的处理，然后做一些事。<br>这里主要从锁屏的界面Layout结构、touchEvent事件分发、解锁动作逻辑几个方面进行源码的分析。</p>
<h3 id="锁屏的界面Layout结构分析"><a href="#锁屏的界面Layout结构分析" class="headerlink" title="锁屏的界面Layout结构分析"></a>锁屏的界面Layout结构分析</h3><p><strong>StatusbarWindowView</strong><br>整个锁屏界面的顶级 View 就是 StatusbarWindowView；<br><strong>StatusBar#createAndAddWindows()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">createAndAddWindows</span><span class="params">(<span class="meta">@Nullable</span> RegisterStatusBarResult result)</span> &#123;</span><br><span class="line">    makeStatusBarView(result);</span><br><span class="line">    mNotificationShadeWindowController.attach();</span><br><span class="line">    <span class="comment">// 添加视图</span></span><br><span class="line">    mStatusBarWindowController.attach();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>StatusBarWindowController#attach()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">attach</span><span class="params">()</span> &#123;</span><br><span class="line">    <span class="comment">// Now that the status bar window encompasses the sliding panel and its</span></span><br><span class="line">    <span class="comment">// translucent backdrop, the entire thing is made TRANSLUCENT and is</span></span><br><span class="line">    <span class="comment">// hardware-accelerated.</span></span><br><span class="line">    mLp = <span class="keyword">new</span> <span class="title class_">WindowManager</span>.LayoutParams(</span><br><span class="line">            ViewGroup.LayoutParams.MATCH_PARENT,</span><br><span class="line">            mBarHeight,</span><br><span class="line">            WindowManager.LayoutParams.TYPE_STATUS_BAR,</span><br><span class="line">            WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE</span><br><span class="line">                    | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH</span><br><span class="line">                    | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,</span><br><span class="line">            PixelFormat.TRANSLUCENT);</span><br><span class="line">    mLp.privateFlags |= PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC;</span><br><span class="line">    mLp.token = <span class="keyword">new</span> <span class="title class_">Binder</span>();</span><br><span class="line">    mLp.gravity = Gravity.TOP;</span><br><span class="line">    mLp.setFitInsetsTypes(<span class="number">0</span> <span class="comment">/* types */</span>);</span><br><span class="line">    mLp.setTitle(<span class="string">&quot;StatusBar&quot;</span>);</span><br><span class="line">    mLp.packageName = mContext.getPackageName();</span><br><span class="line">    mLp.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;</span><br><span class="line">    mWindowManager.addView(mStatusBarView, mLp);</span><br><span class="line">    mLpChanged.copyFrom(mLp);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>StatusBarWindow 是在 StatusBar 的 createAndAddWindows() 流程中调用StatusBarWindowController.attach() 添加到窗口上的， type为WindowManager.LayoutParams.TYPE_STATUS_BAR</p>
<h3 id="Layout结构"><a href="#Layout结构" class="headerlink" title="Layout结构"></a>Layout结构</h3><p>锁屏界面的Layout结构可以简单概括为以下结构：</p>
<ul>
<li>mStatusBarWindow–&gt; R.layout.super_status_bar</li>
<li>notification_panel–&gt; R.layout.status_bar_expanded</li>
<li>keyguardBouncer–&gt;R.layout.keyguard_bouncer<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">mStatusBarWindow--&gt;notification_panel--&gt;notification_container_parent--&gt;keyguard_header（锁屏状态栏）</span><br><span class="line">                |                    |</span><br><span class="line">                |                    --&gt;keyguard_bottom_area （lock_icon和充电状态等）</span><br><span class="line">                |                    |</span><br><span class="line">                |                    --&gt;keyguard_status_view （锁屏时钟日期）</span><br><span class="line">                |                    |</span><br><span class="line">                |                    --&gt;keyguard_up_slide （箭头提示动画）</span><br><span class="line">                |</span><br><span class="line">                --&gt;keyguardBouncer（安全锁界面）</span><br></pre></td></tr></table></figure></li>
</ul>
<h3 id="touchEvent事件分发"><a href="#touchEvent事件分发" class="headerlink" title="touchEvent事件分发"></a>touchEvent事件分发</h3><p>我们这里分析上滑解锁过程中的touchEvent事件分发<br>android中的事件分发概念：事件序列。</p>
<h3 id="事件序列"><a href="#事件序列" class="headerlink" title="事件序列"></a>事件序列</h3><p>在Android系统中，一个单独的事件基本上是没什么作用的，只有一个事件序列，才有意义。一个事件序列正常情况下，定义为 DOWN、MOVE（0或者多个）、UP/CANCEL。事件序列以DOWN事件开始，中间会有0或者多个MOVE事件，最后以UP事件或者CANCEL事件结束。<br>DOWN事件作为序列的开始，有一个很重要的职责，就是寻找事件序列的接受者，怎么理解呢？framework 在DOWN事件的传递过程中，需要根据View事件处理方法（onTouchEvent）的返回值来确定事件序列的接受者。如果一个View的onTouchEvent事件，在处理DOWN事件的时候返回true，说明它愿意接受并处理该事件序列。</p>
<h3 id="上滑解锁"><a href="#上滑解锁" class="headerlink" title="上滑解锁"></a>上滑解锁</h3><p>当用户移动手指时，产生touch down事件，最外层view StatusBarWindowView会执行onInterceptTouchEvent，看是否需要拦截touch事件。再一级级往子View传递，都没有被拦截，之后执行OnTouchEvent从子View开始一级级往父View传递，到PanelView这里当手指移动的距离达到一定的阈值会调用onTrackingStarted从而设置mTracking的值为true，onTouchEvent返回true，接收此touch move事件，之后的touch事件直接传到此View。<br>在用户滑动过程会调用setExpandedHeightInternal,进而调用NotificationPanelView的onHeightUpdated进行锁屏上的时间和通知View根据手指的移动距离进行缩小、变透明处理。<br>当用户抬起手指时，产生touch up事件，PanelView接收到这个事件后会调用endMotionEvent，如果手指从down到up之间移动的距离达到一定阈值会调用onTrackingStopped。</p>
<ol>
<li>硬件发出指令：按下，移动，抬起</li>
<li>input接收</li>
<li>代码执行相应操作：ACTION_DOWN，ACTION_MOVE，ACTION_UP</li>
</ol>
<p><strong>PanelView#onInterceptTouchEvent()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="keyword">public</span> <span class="type">boolean</span> <span class="title function_">onInterceptTouchEvent</span><span class="params">(MotionEvent event)</span> &#123;</span><br><span class="line">    <span class="keyword">return</span> mTouchHandler.onInterceptTouchEvent(event);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>PanelViewController</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">TouchHandler</span> <span class="keyword">implements</span> <span class="title class_">View</span>.OnTouchListener &#123;</span><br><span class="line">     <span class="keyword">public</span> <span class="type">boolean</span> <span class="title function_">onInterceptTouchEvent</span><span class="params">(MotionEvent event)</span> &#123;</span><br><span class="line">         <span class="keyword">if</span> (mInstantExpanding || !mNotificationsDragEnabled || mTouchDisabled || (mMotionAborted</span><br><span class="line">                 &amp;&amp; event.getActionMasked() != MotionEvent.ACTION_DOWN)) &#123;</span><br><span class="line">             <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">         &#125;</span><br><span class="line"> </span><br><span class="line">         <span class="comment">/*</span></span><br><span class="line"><span class="comment">          * If the user drags anywhere inside the panel we intercept it if the movement is</span></span><br><span class="line"><span class="comment">          * upwards. This allows closing the shade from anywhere inside the panel.</span></span><br><span class="line"><span class="comment">          *</span></span><br><span class="line"><span class="comment">          * We only do this if the current content is scrolled to the bottom,</span></span><br><span class="line"><span class="comment">          * i.e canCollapsePanelOnTouch() is true and therefore there is no conflicting scrolling</span></span><br><span class="line"><span class="comment">          * gesture</span></span><br><span class="line"><span class="comment">          * possible.</span></span><br><span class="line"><span class="comment">          */</span></span><br><span class="line">         <span class="type">int</span> <span class="variable">pointerIndex</span> <span class="operator">=</span> event.findPointerIndex(mTrackingPointer);</span><br><span class="line">         <span class="keyword">if</span> (pointerIndex &lt; <span class="number">0</span>) &#123;</span><br><span class="line">             pointerIndex = <span class="number">0</span>;</span><br><span class="line">             mTrackingPointer = event.getPointerId(pointerIndex);</span><br><span class="line">         &#125;</span><br><span class="line">         <span class="keyword">final</span> <span class="type">float</span> <span class="variable">x</span> <span class="operator">=</span> event.getX(pointerIndex);</span><br><span class="line">         <span class="keyword">final</span> <span class="type">float</span> <span class="variable">y</span> <span class="operator">=</span> event.getY(pointerIndex);</span><br><span class="line">         <span class="type">boolean</span> <span class="variable">canCollapsePanel</span> <span class="operator">=</span> canCollapsePanelOnTouch();</span><br><span class="line"> </span><br><span class="line">         <span class="keyword">switch</span> (event.getActionMasked()) &#123;</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_DOWN:</span><br><span class="line">                 mStatusBar.userActivity();</span><br><span class="line">                 mAnimatingOnDown = mHeightAnimator != <span class="literal">null</span>;</span><br><span class="line">                 mMinExpandHeight = <span class="number">0.0f</span>;</span><br><span class="line">                 mDownTime = SystemClock.uptimeMillis();</span><br><span class="line">                 <span class="keyword">if</span> (mAnimatingOnDown &amp;&amp; mClosing &amp;&amp; !mHintAnimationRunning</span><br><span class="line">                         || mPeekAnimator != <span class="literal">null</span>) &#123;</span><br><span class="line">                     cancelHeightAnimator();</span><br><span class="line">                     cancelPeek();</span><br><span class="line">                     mTouchSlopExceeded = <span class="literal">true</span>;</span><br><span class="line">                     <span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">                 &#125;</span><br><span class="line">                 mInitialTouchY = y;</span><br><span class="line">                 mInitialTouchX = x;</span><br><span class="line">                 mTouchStartedInEmptyArea = !isInContentBounds(x, y);</span><br><span class="line">                 mTouchSlopExceeded = mTouchSlopExceededBeforeDown;</span><br><span class="line">                 mJustPeeked = <span class="literal">false</span>;</span><br><span class="line">                 mMotionAborted = <span class="literal">false</span>;</span><br><span class="line">                 mPanelClosedOnDown = isFullyCollapsed();</span><br><span class="line">                 mCollapsedAndHeadsUpOnDown = <span class="literal">false</span>;</span><br><span class="line">                 mHasLayoutedSinceDown = <span class="literal">false</span>;</span><br><span class="line">                 mUpdateFlingOnLayout = <span class="literal">false</span>;</span><br><span class="line">                 mTouchAboveFalsingThreshold = <span class="literal">false</span>;</span><br><span class="line">                 addMovement(event);</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_POINTER_UP:</span><br><span class="line">                 <span class="keyword">final</span> <span class="type">int</span> <span class="variable">upPointer</span> <span class="operator">=</span> event.getPointerId(event.getActionIndex());</span><br><span class="line">                 <span class="keyword">if</span> (mTrackingPointer == upPointer) &#123;</span><br><span class="line">                     <span class="comment">// gesture is ongoing, find a new pointer to track</span></span><br><span class="line">                     <span class="keyword">final</span> <span class="type">int</span> <span class="variable">newIndex</span> <span class="operator">=</span> event.getPointerId(<span class="number">0</span>) != upPointer ? <span class="number">0</span> : <span class="number">1</span>;</span><br><span class="line">                     mTrackingPointer = event.getPointerId(newIndex);</span><br><span class="line">                     mInitialTouchX = event.getX(newIndex);</span><br><span class="line">                     mInitialTouchY = event.getY(newIndex);</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_POINTER_DOWN:</span><br><span class="line">                 <span class="keyword">if</span> (mStatusBarStateController.getState() == StatusBarState.KEYGUARD) &#123;</span><br><span class="line">                     mMotionAborted = <span class="literal">true</span>;</span><br><span class="line">                     mVelocityTracker.clear();</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_MOVE:</span><br><span class="line">                 <span class="keyword">final</span> <span class="type">float</span> <span class="variable">h</span> <span class="operator">=</span> y - mInitialTouchY;</span><br><span class="line">                 addMovement(event);</span><br><span class="line">                 <span class="keyword">if</span> (canCollapsePanel || mTouchStartedInEmptyArea || mAnimatingOnDown) &#123;</span><br><span class="line">                     <span class="type">float</span> <span class="variable">hAbs</span> <span class="operator">=</span> Math.abs(h);</span><br><span class="line">                     <span class="type">float</span> <span class="variable">touchSlop</span> <span class="operator">=</span> getTouchSlop(event);</span><br><span class="line">                     <span class="keyword">if</span> ((h &lt; -touchSlop || (mAnimatingOnDown &amp;&amp; hAbs &gt; touchSlop))</span><br><span class="line">                             &amp;&amp; hAbs &gt; Math.abs(x - mInitialTouchX)) &#123;</span><br><span class="line">                         cancelHeightAnimator();</span><br><span class="line">                         startExpandMotion(x, y, <span class="literal">true</span> <span class="comment">/* startTracking */</span>, mExpandedHeight);</span><br><span class="line">                         <span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">                     &#125;</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_CANCEL:</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_UP:</span><br><span class="line">                 mVelocityTracker.clear();</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line">         &#125;</span><br><span class="line">         <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">     &#125;</span><br><span class="line"> </span><br><span class="line">     <span class="meta">@Override</span></span><br><span class="line">     <span class="keyword">public</span> <span class="type">boolean</span> <span class="title function_">onTouch</span><span class="params">(View v, MotionEvent event)</span> &#123;</span><br><span class="line">         <span class="keyword">if</span> (mInstantExpanding || (mTouchDisabled</span><br><span class="line">                 &amp;&amp; event.getActionMasked() != MotionEvent.ACTION_CANCEL) || (mMotionAborted</span><br><span class="line">                 &amp;&amp; event.getActionMasked() != MotionEvent.ACTION_DOWN)) &#123;</span><br><span class="line">             <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">         &#125;</span><br><span class="line"> </span><br><span class="line">         <span class="comment">// If dragging should not expand the notifications shade, then return false.</span></span><br><span class="line">         <span class="keyword">if</span> (!mNotificationsDragEnabled) &#123;</span><br><span class="line">             <span class="keyword">if</span> (mTracking) &#123;</span><br><span class="line">                 <span class="comment">// Turn off tracking if it&#x27;s on or the shade can get stuck in the down position.</span></span><br><span class="line">                 onTrackingStopped(<span class="literal">true</span> <span class="comment">/* expand */</span>);</span><br><span class="line">             &#125;</span><br><span class="line">             <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">         &#125;</span><br><span class="line"> </span><br><span class="line">         <span class="comment">// On expanding, single mouse click expands the panel instead of dragging.</span></span><br><span class="line">         <span class="keyword">if</span> (isFullyCollapsed() &amp;&amp; event.isFromSource(InputDevice.SOURCE_MOUSE)) &#123;</span><br><span class="line">             <span class="keyword">if</span> (event.getAction() == MotionEvent.ACTION_UP) &#123;</span><br><span class="line">                 expand(<span class="literal">true</span>);</span><br><span class="line">             &#125;</span><br><span class="line">             <span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">         &#125;</span><br><span class="line"> </span><br><span class="line">         <span class="comment">/*</span></span><br><span class="line"><span class="comment">          * We capture touch events here and update the expand height here in case according to</span></span><br><span class="line"><span class="comment">          * the users fingers. This also handles multi-touch.</span></span><br><span class="line"><span class="comment">          *</span></span><br><span class="line"><span class="comment">          * If the user just clicks shortly, we show a quick peek of the shade.</span></span><br><span class="line"><span class="comment">          *</span></span><br><span class="line"><span class="comment">          * Flinging is also enabled in order to open or close the shade.</span></span><br><span class="line"><span class="comment">          */</span></span><br><span class="line"> </span><br><span class="line">         <span class="type">int</span> <span class="variable">pointerIndex</span> <span class="operator">=</span> event.findPointerIndex(mTrackingPointer);</span><br><span class="line">         <span class="keyword">if</span> (pointerIndex &lt; <span class="number">0</span>) &#123;</span><br><span class="line">             pointerIndex = <span class="number">0</span>;</span><br><span class="line">             mTrackingPointer = event.getPointerId(pointerIndex);</span><br><span class="line">         &#125;</span><br><span class="line">         <span class="keyword">final</span> <span class="type">float</span> <span class="variable">x</span> <span class="operator">=</span> event.getX(pointerIndex);</span><br><span class="line">         <span class="keyword">final</span> <span class="type">float</span> <span class="variable">y</span> <span class="operator">=</span> event.getY(pointerIndex);</span><br><span class="line"> </span><br><span class="line">         <span class="keyword">if</span> (event.getActionMasked() == MotionEvent.ACTION_DOWN) &#123;</span><br><span class="line">             mGestureWaitForTouchSlop = shouldGestureWaitForTouchSlop();</span><br><span class="line">             mIgnoreXTouchSlop = isFullyCollapsed() || shouldGestureIgnoreXTouchSlop(x, y);</span><br><span class="line">         &#125;</span><br><span class="line"> </span><br><span class="line">         <span class="keyword">switch</span> (event.getActionMasked()) &#123;</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_DOWN:</span><br><span class="line">                 startExpandMotion(x, y, <span class="literal">false</span> <span class="comment">/* startTracking */</span>, mExpandedHeight);</span><br><span class="line">                 mJustPeeked = <span class="literal">false</span>;</span><br><span class="line">                 mMinExpandHeight = <span class="number">0.0f</span>;</span><br><span class="line">                 mPanelClosedOnDown = isFullyCollapsed();</span><br><span class="line">                 mHasLayoutedSinceDown = <span class="literal">false</span>;</span><br><span class="line">                 mUpdateFlingOnLayout = <span class="literal">false</span>;</span><br><span class="line">                 mMotionAborted = <span class="literal">false</span>;</span><br><span class="line">                 mPeekTouching = mPanelClosedOnDown;</span><br><span class="line">                 mDownTime = SystemClock.uptimeMillis();</span><br><span class="line">                 mTouchAboveFalsingThreshold = <span class="literal">false</span>;</span><br><span class="line">                 mCollapsedAndHeadsUpOnDown =</span><br><span class="line">                         isFullyCollapsed() &amp;&amp; mHeadsUpManager.hasPinnedHeadsUp();</span><br><span class="line">                 addMovement(event);</span><br><span class="line">                 <span class="keyword">if</span> (!mGestureWaitForTouchSlop || (mHeightAnimator != <span class="literal">null</span></span><br><span class="line">                         &amp;&amp; !mHintAnimationRunning) || mPeekAnimator != <span class="literal">null</span>) &#123;</span><br><span class="line">                     mTouchSlopExceeded =</span><br><span class="line">                             (mHeightAnimator != <span class="literal">null</span> &amp;&amp; !mHintAnimationRunning)</span><br><span class="line">                                     || mPeekAnimator != <span class="literal">null</span> || mTouchSlopExceededBeforeDown;</span><br><span class="line">                     cancelHeightAnimator();</span><br><span class="line">                     cancelPeek();</span><br><span class="line">                     onTrackingStarted();</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">if</span> (isFullyCollapsed() &amp;&amp; !mHeadsUpManager.hasPinnedHeadsUp()</span><br><span class="line">                         &amp;&amp; !mStatusBar.isBouncerShowing()) &#123;</span><br><span class="line">                     startOpening(event);</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line"> </span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_POINTER_UP:</span><br><span class="line">                 <span class="keyword">final</span> <span class="type">int</span> <span class="variable">upPointer</span> <span class="operator">=</span> event.getPointerId(event.getActionIndex());</span><br><span class="line">                 <span class="keyword">if</span> (mTrackingPointer == upPointer) &#123;</span><br><span class="line">                     <span class="comment">// gesture is ongoing, find a new pointer to track</span></span><br><span class="line">                     <span class="keyword">final</span> <span class="type">int</span> <span class="variable">newIndex</span> <span class="operator">=</span> event.getPointerId(<span class="number">0</span>) != upPointer ? <span class="number">0</span> : <span class="number">1</span>;</span><br><span class="line">                     <span class="keyword">final</span> <span class="type">float</span> <span class="variable">newY</span> <span class="operator">=</span> event.getY(newIndex);</span><br><span class="line">                     <span class="keyword">final</span> <span class="type">float</span> <span class="variable">newX</span> <span class="operator">=</span> event.getX(newIndex);</span><br><span class="line">                     mTrackingPointer = event.getPointerId(newIndex);</span><br><span class="line">                     startExpandMotion(newX, newY, <span class="literal">true</span> <span class="comment">/* startTracking */</span>, mExpandedHeight);</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_POINTER_DOWN:</span><br><span class="line">                 <span class="keyword">if</span> (mStatusBarStateController.getState() == StatusBarState.KEYGUARD) &#123;</span><br><span class="line">                     mMotionAborted = <span class="literal">true</span>;</span><br><span class="line">                     endMotionEvent(event, x, y, <span class="literal">true</span> <span class="comment">/* forceCancel */</span>);</span><br><span class="line">                     <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_MOVE:</span><br><span class="line">                 addMovement(event);</span><br><span class="line">                 <span class="type">float</span> <span class="variable">h</span> <span class="operator">=</span> y - mInitialTouchY;</span><br><span class="line"> </span><br><span class="line">                 <span class="comment">// If the panel was collapsed when touching, we only need to check for the</span></span><br><span class="line">                 <span class="comment">// y-component of the gesture, as we have no conflicting horizontal gesture.</span></span><br><span class="line">                 <span class="keyword">if</span> (Math.abs(h) &gt; getTouchSlop(event)</span><br><span class="line">                         &amp;&amp; (Math.abs(h) &gt; Math.abs(x - mInitialTouchX)</span><br><span class="line">                         || mIgnoreXTouchSlop)) &#123;</span><br><span class="line">                     mTouchSlopExceeded = <span class="literal">true</span>;</span><br><span class="line">                     <span class="keyword">if</span> (mGestureWaitForTouchSlop &amp;&amp; !mTracking &amp;&amp; !mCollapsedAndHeadsUpOnDown) &#123;</span><br><span class="line">                         <span class="keyword">if</span> (!mJustPeeked &amp;&amp; mInitialOffsetOnTouch != <span class="number">0f</span>) &#123;</span><br><span class="line">                             startExpandMotion(x, y, <span class="literal">false</span> <span class="comment">/* startTracking */</span>, mExpandedHeight);</span><br><span class="line">                             h = <span class="number">0</span>;</span><br><span class="line">                         &#125;</span><br><span class="line">                         cancelHeightAnimator();</span><br><span class="line">                         <span class="comment">// 向上滑动时，手指移动的距离达到一定的阈值会调用onTrackingStarted，</span></span><br><span class="line">                         <span class="comment">// 设置mTracking值为true，从而接收touch事件</span></span><br><span class="line">                         onTrackingStarted();</span><br><span class="line">                     &#125;</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="type">float</span> <span class="variable">newHeight</span> <span class="operator">=</span> Math.max(<span class="number">0</span>, h + mInitialOffsetOnTouch);</span><br><span class="line">                 <span class="keyword">if</span> (newHeight &gt; mPeekHeight) &#123;</span><br><span class="line">                     <span class="keyword">if</span> (mPeekAnimator != <span class="literal">null</span>) &#123;</span><br><span class="line">                         mPeekAnimator.cancel();</span><br><span class="line">                     &#125;</span><br><span class="line">                     mJustPeeked = <span class="literal">false</span>;</span><br><span class="line">                 &#125; <span class="keyword">else</span> <span class="keyword">if</span> (mPeekAnimator == <span class="literal">null</span> &amp;&amp; mJustPeeked) &#123;</span><br><span class="line">                     <span class="comment">// The initial peek has finished, but we haven&#x27;t dragged as far yet, lets</span></span><br><span class="line">                     <span class="comment">// speed it up by starting at the peek height.</span></span><br><span class="line">                     mInitialOffsetOnTouch = mExpandedHeight;</span><br><span class="line">                     mInitialTouchY = y;</span><br><span class="line">                     mMinExpandHeight = mExpandedHeight;</span><br><span class="line">                     mJustPeeked = <span class="literal">false</span>;</span><br><span class="line">                 &#125;</span><br><span class="line">                 newHeight = Math.max(newHeight, mMinExpandHeight);</span><br><span class="line">                 <span class="keyword">if</span> (-h &gt;= getFalsingThreshold()) &#123;</span><br><span class="line">                     mTouchAboveFalsingThreshold = <span class="literal">true</span>;</span><br><span class="line">                     mUpwardsWhenThresholdReached = isDirectionUpwards(x, y);</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">if</span> (!mJustPeeked &amp;&amp; (!mGestureWaitForTouchSlop || mTracking)</span><br><span class="line">                         &amp;&amp; !isTrackingBlocked()) &#123;</span><br><span class="line">                     <span class="comment">// 用户滑动过程会调用setExpandedHeightInternal</span></span><br><span class="line">                     setExpandedHeightInternal(newHeight);</span><br><span class="line">                 &#125;</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line"> </span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_UP:</span><br><span class="line">             <span class="keyword">case</span> MotionEvent.ACTION_CANCEL:</span><br><span class="line">                 addMovement(event);</span><br><span class="line">                 endMotionEvent(event, x, y, <span class="literal">false</span> <span class="comment">/* forceCancel */</span>);</span><br><span class="line">                 <span class="keyword">break</span>;</span><br><span class="line">         &#125;</span><br><span class="line">         <span class="keyword">return</span> !mGestureWaitForTouchSlop || mTracking;</span><br><span class="line">     &#125;</span><br><span class="line"> &#125;</span><br></pre></td></tr></table></figure>
<p>移动过程中：主要在调用了两个方法。<br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">protected</span> <span class="keyword">void</span> <span class="title function_">onTrackingStarted</span><span class="params">()</span> &#123;</span><br><span class="line">        endClosing();</span><br><span class="line">        mTracking = <span class="literal">true</span>;</span><br><span class="line">        mBar.onTrackingStarted();</span><br><span class="line">        notifyExpandingStarted();</span><br><span class="line">        notifyBarPanelExpansionChanged();</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">setExpandedHeightInternal</span><span class="params">(<span class="type">float</span> h)</span> &#123;</span><br><span class="line">        <span class="keyword">if</span> (isNaN(h)) &#123;</span><br><span class="line">            Log.wtf(TAG, <span class="string">&quot;ExpandedHeight set to NaN&quot;</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (mExpandLatencyTracking &amp;&amp; h != <span class="number">0f</span>) &#123;</span><br><span class="line">            DejankUtils.postAfterTraversal(</span><br><span class="line">                    () -&gt; mLatencyTracker.onActionEnd(LatencyTracker.ACTION_EXPAND_PANEL));</span><br><span class="line">            mExpandLatencyTracking = <span class="literal">false</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="type">float</span> <span class="variable">fhWithoutOverExpansion</span> <span class="operator">=</span> getMaxPanelHeight() - getOverExpansionAmount();</span><br><span class="line">        <span class="keyword">if</span> (mHeightAnimator == <span class="literal">null</span>) &#123;</span><br><span class="line">            <span class="type">float</span> <span class="variable">overExpansionPixels</span> <span class="operator">=</span> Math.max(<span class="number">0</span>, h - fhWithoutOverExpansion);</span><br><span class="line">            <span class="keyword">if</span> (getOverExpansionPixels() != overExpansionPixels &amp;&amp; mTracking) &#123;</span><br><span class="line">                setOverExpansion(overExpansionPixels, <span class="literal">true</span> <span class="comment">/* isPixels */</span>);</span><br><span class="line">            &#125;</span><br><span class="line">            mExpandedHeight = Math.min(h, fhWithoutOverExpansion) + getOverExpansionAmount();</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            mExpandedHeight = h;</span><br><span class="line">            <span class="keyword">if</span> (mOverExpandedBeforeFling) &#123;</span><br><span class="line">                setOverExpansion(Math.max(<span class="number">0</span>, h - fhWithoutOverExpansion), <span class="literal">false</span> <span class="comment">/* isPixels */</span>);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"> </span><br><span class="line">        <span class="comment">// If we are closing the panel and we are almost there due to a slow decelerating</span></span><br><span class="line">        <span class="comment">// interpolator, abort the animation.</span></span><br><span class="line">        <span class="keyword">if</span> (mExpandedHeight &lt; <span class="number">1f</span> &amp;&amp; mExpandedHeight != <span class="number">0f</span> &amp;&amp; mClosing) &#123;</span><br><span class="line">            mExpandedHeight = <span class="number">0f</span>;</span><br><span class="line">            <span class="keyword">if</span> (mHeightAnimator != <span class="literal">null</span>) &#123;</span><br><span class="line">                mHeightAnimator.end();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        mExpandedFraction = Math.min(<span class="number">1f</span>,</span><br><span class="line">                fhWithoutOverExpansion == <span class="number">0</span> ? <span class="number">0</span> : mExpandedHeight / fhWithoutOverExpansion);</span><br><span class="line">        <span class="comment">// 进行锁屏上的时间和通知View根据手指的移动距离进行缩小、变透明处理 </span></span><br><span class="line">        onHeightUpdated(mExpandedHeight);</span><br><span class="line">        notifyBarPanelExpansionChanged();</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>下面主要从：onHeightUpdated、notifyBarPanelExpansionChanged 两方法作为入口。<br>先看 <strong>NotificationPanelViewController#onHeightUpdated()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="keyword">protected</span> <span class="keyword">void</span> <span class="title function_">onHeightUpdated</span><span class="params">(<span class="type">float</span> expandedHeight)</span> &#123;</span><br><span class="line">    <span class="keyword">if</span> (!mQsExpanded || mQsExpandImmediate || mIsExpanding &amp;&amp; mQsExpandedWhenExpandingStarted) &#123;</span><br><span class="line">        <span class="comment">// 更新时钟位置将设置顶部填充，这可能会触发新的面板高度并重新定位时钟。</span></span><br><span class="line">        <span class="comment">// 这是一个循环依赖项，应该避免，否则会出现堆栈溢出。</span></span><br><span class="line">        <span class="keyword">if</span> (mStackScrollerMeasuringPass &gt; <span class="number">2</span>) &#123;</span><br><span class="line">            <span class="keyword">if</span> (DEBUG) Log.d(TAG, <span class="string">&quot;Unstable notification panel height. Aborting.&quot;</span>);</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="comment">//锁屏上的时间和通知View根据手指的移动距离进行缩小、变透明处理</span></span><br><span class="line">            positionClockAndNotifications();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">if</span> (mQsExpandImmediate || mQsExpanded &amp;&amp; !mQsTracking &amp;&amp; mQsExpansionAnimator == <span class="literal">null</span></span><br><span class="line">            &amp;&amp; !mQsExpansionFromOverscroll) &#123;</span><br><span class="line">        <span class="type">float</span> t;</span><br><span class="line">        <span class="keyword">if</span> (mKeyguardShowing) &#123;</span><br><span class="line">            <span class="comment">// 在Keyguard上，将QS扩展线性插值到面板扩展</span></span><br><span class="line">            t = expandedHeight / (getMaxPanelHeight());</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="comment">// In Shade, interpolate linearly such that QS is closed whenever panel height is</span></span><br><span class="line">            <span class="comment">// minimum QS expansion + minStackHeight</span></span><br><span class="line">            <span class="type">float</span></span><br><span class="line">                    <span class="variable">panelHeightQsCollapsed</span> <span class="operator">=</span></span><br><span class="line">                    mNotificationStackScroller.getIntrinsicPadding()</span><br><span class="line">                            + mNotificationStackScroller.getLayoutMinHeight();</span><br><span class="line">            <span class="type">float</span> <span class="variable">panelHeightQsExpanded</span> <span class="operator">=</span> calculatePanelHeightQsExpanded();</span><br><span class="line">            t =</span><br><span class="line">                    (expandedHeight - panelHeightQsCollapsed) / (panelHeightQsExpanded</span><br><span class="line">                            - panelHeightQsCollapsed);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="type">float</span></span><br><span class="line">                <span class="variable">targetHeight</span> <span class="operator">=</span></span><br><span class="line">                mQsMinExpansionHeight + t * (mQsMaxExpansionHeight - mQsMinExpansionHeight);</span><br><span class="line">        setQsExpansion(targetHeight);</span><br><span class="line">    &#125;</span><br><span class="line">    updateExpandedHeight(expandedHeight);</span><br><span class="line">    updateHeader();</span><br><span class="line">    <span class="comment">// 更新通知半透明</span></span><br><span class="line">    updateNotificationTranslucency();</span><br><span class="line">    updatePanelExpanded();</span><br><span class="line">    updateGestureExclusionRect();</span><br><span class="line">    <span class="keyword">if</span> (DEBUG) &#123;</span><br><span class="line">        mView.invalidate();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>到这里了就一起看个滑动解锁的堆栈：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  : java.lang.Throwable:</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.keyguard.KeyguardSecurityContainer.showNextSecurityScreenOrFinish(KeyguardSecurityContainer.java:710)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.keyguard.KeyguardHostView.dismiss(KeyguardHostView.java:214)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.keyguard.KeyguardHostView.dismiss(KeyguardHostView.java:196)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.systemui.statusbar.phone.KeyguardBouncer.show(KeyguardBouncer.java:167)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.showBouncer(StatusBarKeyguardViewManager.java:434)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.systemui.statusbar.phone.StatusBar.showBouncerIfKeyguard(StatusBar.java:3959)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.systemui.statusbar.phone.StatusBar.makeExpandedInvisible(StatusBar.java:2506)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.systemui.statusbar.phone.PhoneStatusBarView$1.run(PhoneStatusBarView.java:65)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at android.os.Handler.handleCallback(Handler.java:938)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at android.os.Handler.dispatchMessage(Handler.java:99)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at android.os.Looper.loop(Looper.java:223)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at android.app.ActivityThread.main(ActivityThread.java:7945)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at java.lang.reflect.Method.invoke(Native Method)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:603)</span><br><span class="line">12-30 08:32:48.658  1479  1479 D longzhiye  :      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)</span><br></pre></td></tr></table></figure>
<p>再看一个滑动后到密码安全锁（即密码解锁）的堆栈</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: : java.lang.Throwable</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.keyguard.KeyguardSecurityContainer.showNextSecurityScreenOrFinish(KeyguardSecurityContainer.java:710)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.keyguard.KeyguardHostView.dismiss(KeyguardHostView.java:214)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.keyguard.KeyguardHostView.dismiss(KeyguardHostView.java:196)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.systemui.statusbar.phone.KeyguardBouncer.show(KeyguardBouncer.java:167)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.onPanelExpansionChanged(StatusBarKeyguardViewManager.java:297)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.systemui.statusbar.phone.PanelViewController.notifyBarPanelExpansionChanged(PanelViewController.java:1011)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.systemui.statusbar.phone.PanelViewController.setExpandedHeightInternal(PanelViewController.java:727)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.systemui.statusbar.phone.PanelViewController$TouchHandler.onTouch(PanelViewController.java:1338)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.systemui.statusbar.phone.NotificationPanelViewController$18.onTouch(NotificationPanelViewController.java:3229)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at android.view.View.dispatchTouchEvent(View.java:14385)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2792)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3126)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at com.android.systemui.statusbar.phone.NotificationShadeWindowView.dispatchTouchEvent(NotificationShadeWindowView.java:173)</span><br><span class="line">12-30 09:28:31.8189  1470  1470 D longzhiye: :      at android.view.View.dispatchPointerEvent(View.java:14656)</span><br><span class="line">// 省略部分Log....</span><br></pre></td></tr></table></figure>
<p>接着看 <strong>PanelViewController#notifyBarPanelExpansionChanged()</strong></p>
<blockquote>
<p>这里注意：都是到 KeyguardSecurityContainer#KeyguardSecurityContainer(),滑动解锁与带有密码安全界面，即密码解锁，两个流程的代码执行顺序有差异。</p>
</blockquote>
<p>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">protected</span> <span class="keyword">void</span> <span class="title function_">notifyBarPanelExpansionChanged</span><span class="params">()</span> &#123;</span><br><span class="line">    <span class="keyword">if</span> (mBar != <span class="literal">null</span>) &#123;</span><br><span class="line">        mBar.panelExpansionChanged(</span><br><span class="line">                mExpandedFraction,</span><br><span class="line">                mExpandedFraction &gt; <span class="number">0f</span> || mPeekAnimator != <span class="literal">null</span> || mInstantExpanding</span><br><span class="line">                        || isPanelVisibleBecauseOfHeadsUp() || mTracking</span><br><span class="line">                        || mHeightAnimator != <span class="literal">null</span>);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">for</span> (<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i &lt; mExpansionListeners.size(); i++) &#123;</span><br><span class="line">        mExpansionListeners.get(i).onPanelExpansionChanged(mExpandedFraction, mTracking);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>再 notifyBarPanelExpansionChanged() 方法中继而调用 PanelBar 中的panelExpansionChanged方法：页面的透明度。<br><strong>PanelBar#panelExpansionChanged()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">panelExpansionChanged</span><span class="params">(<span class="type">float</span> frac, <span class="type">boolean</span> expanded)</span> &#123;</span><br><span class="line">        <span class="keyword">if</span> (isNaN(frac)) &#123;</span><br><span class="line">            <span class="keyword">throw</span> <span class="keyword">new</span> <span class="title class_">IllegalArgumentException</span>(<span class="string">&quot;frac cannot be NaN&quot;</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="type">boolean</span> <span class="variable">fullyClosed</span> <span class="operator">=</span> <span class="literal">true</span>;</span><br><span class="line">        <span class="type">boolean</span> <span class="variable">fullyOpened</span> <span class="operator">=</span> <span class="literal">false</span>;</span><br><span class="line">        <span class="keyword">if</span> (SPEW) LOG(<span class="string">&quot;panelExpansionChanged: start state=%d&quot;</span>, mState);</span><br><span class="line">        <span class="type">PanelViewController</span> <span class="variable">pv</span> <span class="operator">=</span> mPanel;</span><br><span class="line">        mExpanded = expanded;</span><br><span class="line">        mPanelFraction = frac;</span><br><span class="line">        updateVisibility();</span><br><span class="line">        <span class="comment">// 调整可能部分可见的任何其他面板</span></span><br><span class="line">        <span class="keyword">if</span> (expanded) &#123;</span><br><span class="line">            <span class="keyword">if</span> (mState == STATE_CLOSED) &#123;</span><br><span class="line">                go(STATE_OPENING);</span><br><span class="line">                onPanelPeeked();</span><br><span class="line">            &#125;</span><br><span class="line">            fullyClosed = <span class="literal">false</span>;</span><br><span class="line">            <span class="keyword">final</span> <span class="type">float</span> <span class="variable">thisFrac</span> <span class="operator">=</span> pv.getExpandedFraction();</span><br><span class="line">            <span class="keyword">if</span> (SPEW) LOG(<span class="string">&quot;panelExpansionChanged:  -&gt; %s: f=%.1f&quot;</span>, pv.getName(), thisFrac);</span><br><span class="line">            fullyOpened = thisFrac &gt;= <span class="number">1f</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">// fullyOpened 完全打开；就是：锁屏界面是否完全展开的；（手指不滑动时，fullyOpened  = true，fullyClosed = false；）</span></span><br><span class="line">        <span class="comment">// fullyClosed 完全关闭，就是：锁屏界面是否完全折叠，即消失了；（锁屏界面上滑消失时，fullyOpened = false，fullyClosed  = true）</span></span><br><span class="line">       <span class="comment">// 手指在滑动过程中时：fullyOpened = false，fullyClosed  = false</span></span><br><span class="line">        <span class="keyword">if</span> (fullyOpened &amp;&amp; !mTracking) &#123;</span><br><span class="line">            go(STATE_OPEN);</span><br><span class="line">            onPanelFullyOpened();</span><br><span class="line">        &#125; <span class="keyword">else</span> <span class="keyword">if</span> (fullyClosed &amp;&amp; !mTracking &amp;&amp; mState != STATE_CLOSED) &#123;</span><br><span class="line">            go(STATE_CLOSED);</span><br><span class="line">            <span class="comment">// 面板折叠时</span></span><br><span class="line">            onPanelCollapsed();</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (SPEW) LOG(<span class="string">&quot;panelExpansionChanged: end state=%d [%s%s ]&quot;</span>, mState,</span><br><span class="line">                fullyOpened?<span class="string">&quot; fullyOpened&quot;</span>:<span class="string">&quot;&quot;</span>, fullyClosed?<span class="string">&quot; fullyClosed&quot;</span>:<span class="string">&quot;&quot;</span>);</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>当锁屏页面完全消失时，调用 onPanelCollapsed() 方法，执行 post() 方法。<br><strong>PhoneStatusBarView#onPanelCollapsed()</strong></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">onPanelCollapsed</span><span class="params">()</span> &#123;</span><br><span class="line">        <span class="built_in">super</span>.onPanelCollapsed();</span><br><span class="line">        <span class="comment">// Close the status bar in the next frame so we can show the end of the animation.</span></span><br><span class="line">        post(mHideExpandedRunnable);</span><br><span class="line">        mIsFullyOpenedPanel = <span class="literal">false</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">private</span> <span class="type">Runnable</span> <span class="variable">mHideExpandedRunnable</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Runnable</span>() &#123;</span><br><span class="line">        <span class="meta">@Override</span></span><br><span class="line">        <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">run</span><span class="params">()</span> &#123;</span><br><span class="line">            <span class="keyword">if</span> (mPanelFraction == <span class="number">0.0f</span>) &#123;</span><br><span class="line">                mBar.makeExpandedInvisible();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;;</span><br></pre></td></tr></table></figure>
<p>接下来执行 StatusBar 中的 makeExpandedInvisible() 方法，更新通知栏和状态栏窗口的可见性。<br><strong>StatusBar#makeExpandedInvisible()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">void</span> <span class="title function_">makeExpandedInvisible</span><span class="params">()</span> &#123;</span><br><span class="line">      <span class="keyword">if</span> (SPEW) Log.d(TAG, <span class="string">&quot;makeExpandedInvisible: mExpandedVisible=&quot;</span> + mExpandedVisible</span><br><span class="line">              + <span class="string">&quot; mExpandedVisible=&quot;</span> + mExpandedVisible);</span><br><span class="line">      <span class="keyword">if</span> (!mExpandedVisible || mNotificationShadeWindowView == <span class="literal">null</span>) &#123;</span><br><span class="line">          <span class="keyword">return</span>;</span><br><span class="line">      &#125;</span><br><span class="line">      <span class="comment">// 确保面板完全折叠</span></span><br><span class="line">      mStatusBarView.collapsePanel(<span class="comment">/*animate=*/</span> <span class="literal">false</span>, <span class="literal">false</span> <span class="comment">/* delayed*/</span>,</span><br><span class="line">              <span class="number">1.0f</span> <span class="comment">/* speedUpFactor */</span>);</span><br><span class="line">      mNotificationPanelViewController.closeQs();</span><br><span class="line">      mExpandedVisible = <span class="literal">false</span>;</span><br><span class="line">      visibilityChanged(<span class="literal">false</span>);</span><br><span class="line">      <span class="comment">// 更新通知阴影和状态栏窗口的可见性</span></span><br><span class="line">      mNotificationShadeWindowController.setPanelVisible(<span class="literal">false</span>);</span><br><span class="line">      mStatusBarWindowController.setForceStatusBarVisible(<span class="literal">false</span>);</span><br><span class="line">      <span class="comment">// Close any guts that might be visible</span></span><br><span class="line">      mGutsManager.closeAndSaveGuts(<span class="literal">true</span> <span class="comment">/* removeLeavebehind */</span>, <span class="literal">true</span> <span class="comment">/* force */</span>,</span><br><span class="line">              <span class="literal">true</span> <span class="comment">/* removeControls */</span>, -<span class="number">1</span> <span class="comment">/* x */</span>, -<span class="number">1</span> <span class="comment">/* y */</span>, <span class="literal">true</span> <span class="comment">/* resetMenu */</span>);</span><br><span class="line">      mShadeController.runPostCollapseRunnables();</span><br><span class="line">      setInteracting(StatusBarManager.WINDOW_STATUS_BAR, <span class="literal">false</span>);</span><br><span class="line">      <span class="keyword">if</span> (!mNotificationActivityStarter.isCollapsingToShowActivityOverLockscreen()) &#123;</span><br><span class="line">          showBouncerIfKeyguard();</span><br><span class="line">      &#125; <span class="keyword">else</span> <span class="keyword">if</span> (DEBUG) &#123;</span><br><span class="line">          Log.d(TAG, <span class="string">&quot;Not showing bouncer due to activity showing over lockscreen&quot;</span>);</span><br><span class="line">      &#125;</span><br><span class="line">      mCommandQueue.recomputeDisableFlags(</span><br><span class="line">              mDisplayId,</span><br><span class="line">              mNotificationPanelViewController.hideStatusBarIconsWhenExpanded() <span class="comment">/* animate */</span>);</span><br><span class="line">      <span class="comment">// Trimming will happen later if Keyguard is showing - doing it here might cause a jank in</span></span><br><span class="line">      <span class="comment">// the bouncer appear animation.</span></span><br><span class="line">      <span class="keyword">if</span> (!mStatusBarKeyguardViewManager.isShowing()) &#123;</span><br><span class="line">          WindowManagerGlobal.getInstance().trimMemory(ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);</span><br><span class="line">      &#125;</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>
<p><strong>StatusBar#showBouncerIfKeyguard()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title function_">showBouncerIfKeyguard</span><span class="params">()</span> &#123;</span><br><span class="line">    <span class="keyword">if</span> ((mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED)</span><br><span class="line">            &amp;&amp; !mKeyguardViewMediator.isHiding()) &#123;</span><br><span class="line">        <span class="comment">// !mKeyguardViewMediator.isHiding() 不管是滑动解锁还是PIN码解锁等方式都是 true</span></span><br><span class="line">        mStatusBarKeyguardViewManager.showBouncer(<span class="literal">true</span> <span class="comment">/* scrimmed */</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>StatusBarKeyguardViewManager#showBouncer()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">showBouncer</span><span class="params">(<span class="type">boolean</span> scrimmed)</span> &#123;</span><br><span class="line">    <span class="comment">// 如果是滑动解锁，这里 if 条件是 true，如果是密码解锁，这里是 false。</span></span><br><span class="line">    <span class="keyword">if</span> (mShowing &amp;&amp; !mBouncer.isShowing()) &#123;</span><br><span class="line">        mBouncer.show(<span class="literal">false</span> <span class="comment">/* resetSecuritySelection */</span>, scrimmed);</span><br><span class="line">    &#125;</span><br><span class="line">    updateStates();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>KeyguardBouncer#show()</strong> 如果有设置密码，则显示安全锁界面<br>frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">show</span><span class="params">(<span class="type">boolean</span> resetSecuritySelection, <span class="type">boolean</span> isScrimmed)</span> &#123;</span><br><span class="line">        <span class="keyword">final</span> <span class="type">int</span> <span class="variable">keyguardUserId</span> <span class="operator">=</span> KeyguardUpdateMonitor.getCurrentUser();</span><br><span class="line">        <span class="keyword">if</span> (keyguardUserId == UserHandle.USER_SYSTEM &amp;&amp; UserManager.isSplitSystemUser()) &#123;</span><br><span class="line">            <span class="comment">// In split system user mode, we never unlock system user.</span></span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        ensureView();</span><br><span class="line">        mIsScrimmed = isScrimmed;</span><br><span class="line">        <span class="keyword">if</span> (isScrimmed) &#123;</span><br><span class="line">            setExpansion(EXPANSION_VISIBLE);</span><br><span class="line">        &#125;</span><br><span class="line"> </span><br><span class="line">        <span class="keyword">if</span> (resetSecuritySelection) &#123;</span><br><span class="line">            showPrimarySecurityScreen();</span><br><span class="line">        &#125;</span><br><span class="line"> </span><br><span class="line">        <span class="keyword">if</span> (mRoot.getVisibility() == View.VISIBLE || mShowingSoon) &#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line"> </span><br><span class="line">        <span class="keyword">final</span> <span class="type">int</span> <span class="variable">activeUserId</span> <span class="operator">=</span> KeyguardUpdateMonitor.getCurrentUser();</span><br><span class="line">        <span class="keyword">final</span> <span class="type">boolean</span> <span class="variable">isSystemUser</span> <span class="operator">=</span></span><br><span class="line">                UserManager.isSplitSystemUser() &amp;&amp; activeUserId == UserHandle.USER_SYSTEM;</span><br><span class="line">        <span class="keyword">final</span> <span class="type">boolean</span> <span class="variable">allowDismissKeyguard</span> <span class="operator">=</span> !isSystemUser &amp;&amp; activeUserId == keyguardUserId;</span><br><span class="line">        <span class="comment">// 重点关注 dismiss()</span></span><br><span class="line">        <span class="keyword">if</span> (allowDismissKeyguard &amp;&amp; mKeyguardView.dismiss(activeUserId)) &#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (!allowDismissKeyguard) &#123;</span><br><span class="line">            Log.w(TAG, <span class="string">&quot;User can&#x27;t dismiss keyguard: &quot;</span> + activeUserId + <span class="string">&quot; != &quot;</span> + keyguardUserId);</span><br><span class="line">        &#125;</span><br><span class="line"> </span><br><span class="line">        mShowingSoon = <span class="literal">true</span>;</span><br><span class="line"> </span><br><span class="line">        <span class="comment">// Split up the work over multiple frames.</span></span><br><span class="line">        DejankUtils.removeCallbacks(mResetRunnable);</span><br><span class="line">        <span class="keyword">if</span> (mKeyguardStateController.isFaceAuthEnabled() &amp;&amp; !needsFullscreenBouncer()</span><br><span class="line">                &amp;&amp; !mKeyguardUpdateMonitor.userNeedsStrongAuth()</span><br><span class="line">                &amp;&amp; !mKeyguardBypassController.getBypassEnabled()) &#123;</span><br><span class="line">            mHandler.postDelayed(mShowRunnable, BOUNCER_FACE_DELAY);</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            DejankUtils.postAfterTraversal(mShowRunnable);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">// 安全锁设置可见性</span></span><br><span class="line">        mCallback.onBouncerVisiblityChanged(<span class="literal">true</span> <span class="comment">/* shown */</span>);</span><br><span class="line">        <span class="comment">// 开始显示</span></span><br><span class="line">        mExpansionCallback.onStartingToShow();</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>这里重点关注 mKeyguardView.dismiss(activeUserId) ;<br><strong>KeyguardHostView#dismiss()</strong><br>frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 显示安全锁</span></span><br><span class="line"><span class="keyword">public</span> <span class="type">boolean</span> <span class="title function_">dismiss</span><span class="params">(<span class="type">int</span> targetUserId)</span> &#123;</span><br><span class="line">    <span class="keyword">return</span> dismiss(<span class="literal">false</span>, targetUserId, <span class="literal">false</span>);</span><br><span class="line">&#125;</span><br><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="keyword">public</span> <span class="type">boolean</span> <span class="title function_">dismiss</span><span class="params">(<span class="type">boolean</span> authenticated, <span class="type">int</span> targetUserId,</span></span><br><span class="line"><span class="params">        <span class="type">boolean</span> bypassSecondaryLockScreen)</span> &#123;</span><br><span class="line">    <span class="comment">// 重点关注</span></span><br><span class="line">    <span class="keyword">return</span> mSecurityContainer.showNextSecurityScreenOrFinish(authenticated, targetUserId,</span><br><span class="line">            bypassSecondaryLockScreen);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>KeyguardSecurityContainer#showNextSecurityScreenOrFinish()</strong><br>frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 显示下一个安全屏幕（如果有）</span></span><br><span class="line"><span class="type">boolean</span> <span class="title function_">showNextSecurityScreenOrFinish</span><span class="params">(<span class="type">boolean</span> authenticated, <span class="type">int</span> targetUserId,</span></span><br><span class="line"><span class="params">        <span class="type">boolean</span> bypassSecondaryLockScreen)</span> &#123;</span><br><span class="line">    <span class="keyword">if</span> (DEBUG) Log.d(TAG, <span class="string">&quot;showNextSecurityScreenOrFinish(&quot;</span> + authenticated + <span class="string">&quot;)&quot;</span>);</span><br><span class="line">    <span class="type">boolean</span> <span class="variable">finish</span> <span class="operator">=</span> <span class="literal">false</span>;</span><br><span class="line">    <span class="type">boolean</span> <span class="variable">strongAuth</span> <span class="operator">=</span> <span class="literal">false</span>;</span><br><span class="line">    <span class="type">int</span> <span class="variable">eventSubtype</span> <span class="operator">=</span> -<span class="number">1</span>;</span><br><span class="line">    <span class="type">int</span> <span class="variable">unLockMode</span> <span class="operator">=</span> <span class="number">0</span>;<span class="comment">// add for KFCAANWIKFRA-833</span></span><br><span class="line">    <span class="type">BouncerUiEvent</span> <span class="variable">uiEvent</span> <span class="operator">=</span> BouncerUiEvent.UNKNOWN;</span><br><span class="line">    <span class="keyword">if</span> (mUpdateMonitor.getUserHasTrust(targetUserId)) &#123;</span><br><span class="line">       <span class="comment">// 省略部分代码......</span></span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (mUpdateMonitor.getUserUnlockedWithBiometric(targetUserId)) &#123;</span><br><span class="line">       <span class="comment">// 省略部分代码......</span></span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (SecurityMode.None == mCurrentSecuritySelection) &#123;  <span class="comment">// mCurrentSecuritySelection当前安全选择的模式</span></span><br><span class="line">        <span class="type">SecurityMode</span> <span class="variable">securityMode</span> <span class="operator">=</span> mSecurityModel.getSecurityMode(targetUserId);</span><br><span class="line">        <span class="keyword">if</span> (SecurityMode.None == securityMode) &#123;</span><br><span class="line">            unLockMode = <span class="number">0</span>;</span><br><span class="line">            finish = <span class="literal">true</span>; <span class="comment">// 没有安全锁</span></span><br><span class="line">            eventSubtype = BOUNCER_DISMISS_NONE_SECURITY;</span><br><span class="line">            uiEvent = BouncerUiEvent.BOUNCER_DISMISS_NONE_SECURITY;</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            showSecurityScreen(securityMode); <span class="comment">// switch to the alternate security view</span></span><br><span class="line">        &#125;</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (authenticated) &#123;</span><br><span class="line">        <span class="comment">// mCurrentSecuritySelection 当前锁的模式</span></span><br><span class="line">        <span class="keyword">switch</span> (mCurrentSecuritySelection) &#123;</span><br><span class="line">            <span class="keyword">case</span> Pattern:</span><br><span class="line">            <span class="keyword">case</span> Password:</span><br><span class="line">            <span class="keyword">case</span> PIN:</span><br><span class="line">                unLockMode = mCurrentSecuritySelection.ordinal() - <span class="number">1</span>;</span><br><span class="line">                strongAuth = <span class="literal">true</span>;</span><br><span class="line">                finish = <span class="literal">true</span>;</span><br><span class="line">                eventSubtype = BOUNCER_DISMISS_PASSWORD;</span><br><span class="line">                uiEvent = BouncerUiEvent.BOUNCER_DISMISS_PASSWORD;</span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">            <span class="comment">// 省略部分代码......</span></span><br><span class="line">            <span class="keyword">default</span>:</span><br><span class="line">                Log.v(TAG, <span class="string">&quot;Bad security screen &quot;</span> + mCurrentSecuritySelection + <span class="string">&quot;, fail safe&quot;</span>);</span><br><span class="line">                showPrimarySecurityScreen(<span class="literal">false</span>);</span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">// 检查设备管理员指定的其他安全措施。</span></span><br><span class="line">    <span class="comment">/* UNISOC: Modify for bug1394148 @&#123; */</span></span><br><span class="line">    <span class="type">Intent</span> <span class="variable">secondaryLockscreenIntent</span> <span class="operator">=</span></span><br><span class="line">            mUpdateMonitor.getSecondaryLockscreenRequirement(targetUserId);</span><br><span class="line">    <span class="keyword">if</span> (finish &amp;&amp; !bypassSecondaryLockScreen &amp;&amp; secondaryLockscreenIntent != <span class="literal">null</span>) &#123;</span><br><span class="line">        mSecondaryLockScreenController.show(secondaryLockscreenIntent);</span><br><span class="line">        <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/* @&#125; */</span></span><br><span class="line">    <span class="keyword">if</span> (eventSubtype != -<span class="number">1</span>) &#123;</span><br><span class="line">        mMetricsLogger.write(<span class="keyword">new</span> <span class="title class_">LogMaker</span>(MetricsEvent.BOUNCER)</span><br><span class="line">                .setType(MetricsEvent.TYPE_DISMISS).setSubtype(eventSubtype));</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">if</span> (uiEvent != BouncerUiEvent.UNKNOWN) &#123;</span><br><span class="line">        sUiEventLogger.log(uiEvent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">// finish 是否还有一个安全屏幕，即是否解锁完成，有则返回 false，没有返回 true</span></span><br><span class="line">    <span class="keyword">if</span> (finish) &#123;</span><br><span class="line">        <span class="comment">// 重点关注</span></span><br><span class="line">        mSecurityCallback.finish(strongAuth, targetUserId);</span><br><span class="line">        <span class="comment">// 省略部分代码......</span></span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> finish;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>KeyguardHostView#finish()</strong><br>frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">finish</span><span class="params">(<span class="type">boolean</span> strongAuth, <span class="type">int</span> targetUserId)</span> &#123;</span><br><span class="line">    <span class="comment">// If there&#x27;s a pending runnable because the user interacted with a widget</span></span><br><span class="line">    <span class="comment">// and we&#x27;re leaving keyguard, then run it.</span></span><br><span class="line">    <span class="type">boolean</span> <span class="variable">deferKeyguardDone</span> <span class="operator">=</span> <span class="literal">false</span>;</span><br><span class="line">    <span class="keyword">if</span> (mDismissAction != <span class="literal">null</span>) &#123;</span><br><span class="line">        deferKeyguardDone = mDismissAction.onDismiss();</span><br><span class="line">        mDismissAction = <span class="literal">null</span>;</span><br><span class="line">        mCancelAction = <span class="literal">null</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">if</span> (mViewMediatorCallback != <span class="literal">null</span>) &#123;</span><br><span class="line">        <span class="keyword">if</span> (deferKeyguardDone) &#123;    <span class="comment">// deferKeyguardDone 上面设置成了 false</span></span><br><span class="line">            mViewMediatorCallback.keyguardDonePending(strongAuth, targetUserId);</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="comment">// 重点关注</span></span><br><span class="line">            mViewMediatorCallback.keyguardDone(strongAuth, targetUserId);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>KeyguardViewMediator#keyguardDone()</strong><br>frameworks/base/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">keyguardDone</span><span class="params">(<span class="type">boolean</span> strongAuth, <span class="type">int</span> targetUserId)</span> &#123;</span><br><span class="line">        <span class="keyword">if</span> (targetUserId != ActivityManager.getCurrentUser()) &#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (DEBUG) Log.d(TAG, <span class="string">&quot;keyguardDone&quot;</span>);</span><br><span class="line">        tryKeyguardDone();</span><br><span class="line">    &#125;</span><br><span class="line"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title function_">tryKeyguardDone</span><span class="params">()</span> &#123;</span><br><span class="line">    <span class="keyword">if</span> (DEBUG) &#123;</span><br><span class="line">        Log.d(TAG, <span class="string">&quot;tryKeyguardDone: pending - &quot;</span> + mKeyguardDonePending + <span class="string">&quot;, animRan - &quot;</span></span><br><span class="line">                + mHideAnimationRun + <span class="string">&quot; animRunning - &quot;</span> + mHideAnimationRunning);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">if</span> (!mKeyguardDonePending &amp;&amp; mHideAnimationRun &amp;&amp; !mHideAnimationRunning) &#123;</span><br><span class="line">        handleKeyguardDone();</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (!mHideAnimationRun) &#123;</span><br><span class="line">        <span class="keyword">if</span> (DEBUG) Log.d(TAG, <span class="string">&quot;tryKeyguardDone: starting pre-hide animation&quot;</span>);</span><br><span class="line">        mHideAnimationRun = <span class="literal">true</span>;</span><br><span class="line">        mHideAnimationRunning = <span class="literal">true</span>;</span><br><span class="line">        mKeyguardViewControllerLazy.get()</span><br><span class="line">                .startPreHideAnimation(mHideAnimationFinishedRunnable);    <span class="comment">// 启动预隐藏动画</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>


      
      <blockquote>
        
        <strong>本文链接：</strong><br><a href="http://longzhiye.top/2023/12/30/2023-12-30/">http://longzhiye.top/2023/12/30/2023-12-30/</a>
      </blockquote>
    </div>
    <footer class="mdui-card-actions">
      
        <a class="mdui-ripple article_categories-link" href="/categories/%E6%8A%80%E6%9C%AF/">技术</a>
      
      
        <a class="mdui-ripple article_tags-link" href="/tags/Android/" rel="tag">Android</a><a class="mdui-ripple article_tags-link" href="/tags/Launcher/" rel="tag">Launcher</a><a class="mdui-ripple article_tags-link" href="/tags/SystemUI/" rel="tag">SystemUI</a><a class="mdui-ripple article_tags-link" href="/tags/framework/" rel="tag">framework</a>
      
    </footer>
    
  </article>
  
<script src="//cdn.bootcdn.net/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="//cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>

  <script>$("#main article .mdui-card-content img.fancybox").on("click",function(e){$.fancybox.open({src:$(this).attr("src")});});</script>


  <nav id="paginator">
    
      <a rel="prev" class="extend prev" href="/2023/12/31/2023-12-31/">
        <button aria-label="prev" class="mdui-btn mdui-btn-raised mdui-btn-icon mdui-color-theme-accent mdui-ripple"><i class="mdui-icon material-icons">arrow_back</i></button>
        <span class="mdui-p-x-3" mdui-tooltip="{content: 'Android 10.0 动态壁纸 LiveWallpaper'}">上一篇</span>
      </a>
    
    <div class="spacer"></div>
    
      <a rel="next" class="extend next" href="/2023/12/24/2023-12-24/">
        <span class="mdui-p-x-3" mdui-tooltip="{content: 'onInterceptTouchEvent() 与 onTouch() 事件分析'}">下一篇</span>
        <button aria-label="next" class="mdui-btn mdui-btn-raised mdui-btn-icon mdui-color-theme-accent mdui-ripple"><i class="mdui-icon material-icons">arrow_forward</i></button>
      </a>
    
  </nav>





</main>
  <footer id="footer" class="mdui-m-t-5 mdui-p-y-3 mdui-color-theme">
  <div class="mdui-p-y-0 mdui-text-center">
    
    
    
    
    
    
    
      <a href="http://github.com/longzhiye" target="_blank" class="mdui-btn mdui-btn-icon mdui-text-color-theme-a100"><i class="mdui-icon iconfont">&#xe7ab;</i></a>
    
    
    
      <a href="https://www.zhihu.com/people/long-zhi-xie-61" target="_blank" class="mdui-btn mdui-btn-icon mdui-text-color-theme-a100"><i class="mdui-icon iconfont">&#xe6c0;</i></a>
    
    
    
      <a href="tencent://tencent:////message/?uin=951898105&Menu=yes" target="_blank" class="mdui-btn mdui-btn-icon mdui-text-color-theme-a100"><i class="mdui-icon iconfont">&#xe651;</i></a>
    
    
  </div>
  <div class="mdui-p-y-1 mdui-text-center">
    Copyright &copy; 2022 - 2025 龙之叶<br>
    Powered by <a href="https://hexo.io/" target="_blank" class="mdui-text-color-theme-accent">Hexo</a>
    <br>
      <span id="busuanzi_container_site_pv" style="display: none;"><i class="iconfont">&#xe7fd;</i> <span id="busuanzi_value_site_pv"></span></span> &nbsp;&nbsp;
      <span id="busuanzi_container_site_uv" style="display: none;"><i class="iconfont">&#xe601;</i> <span id="busuanzi_value_site_uv"></span></span>
    
  </div>
</footer>

  <button id="gotop" class="mdui-fab mdui-fab-fixed mdui-fab-hide mdui-color-theme-accent mdui-ripple"><i class="mdui-icon material-icons">arrow_upward</i></button>
  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
  
<script src="/js/mdui.js"></script>
<script src="/js/script.js"></script>

  
<script src="/custom.js"></script>

</body>
</html>
